blob: afce49c80e23fa244c2c1de7e3b83678424ec332 [file] [log] [blame]
Mohammed Naser7e6654a2022-09-21 17:48:03 -04001name: publish
2
3on:
4 release:
5 types:
6 - published
7
8jobs:
9 ansible-collection:
10 runs-on: ubuntu-latest
11 steps:
12 - name: Checkout project
dependabot[bot]519c1932022-10-05 04:37:24 +000013 uses: actions/checkout@v3.1.0
Mohammed Naser7e6654a2022-09-21 17:48:03 -040014
15 - name: Build and publish collection
16 uses: artis3n/ansible_galaxy_collection@v2
17 with:
18 api_key: "${{ secrets.GALAXY_API_KEY }}"
19
20 - name: Get release
dependabot[bot]69cf6462022-10-27 03:35:59 +000021 uses: bruceadams/get-release@v1.3.2
Mohammed Naser7e6654a2022-09-21 17:48:03 -040022 id: get_release
23 env:
24 GITHUB_TOKEN: ${{ github.token }}
25
26 - name: Get file name for collection
27 id: get_filename
28 run: echo ::set-output name=filename::$(ls *.tar.gz)
29
30 - name: Upload release asset
31 uses: actions/upload-release-asset@v1.0.2
32 env:
33 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 with:
35 upload_url: ${{ steps.get_release.outputs.upload_url }}
36 asset_path: ./${{ steps.get_filename.outputs.filename }}
37 asset_name: ${{ steps.get_filename.outputs.filename }}
38 asset_content_type: application/gzip
39
40 image:
41 runs-on: ubuntu-latest
42 steps:
43 - name: Install QEMU static binaries
dependabot[bot]620f4ea2022-10-13 17:23:48 +000044 uses: docker/setup-qemu-action@v2.1.0
Mohammed Naser7e6654a2022-09-21 17:48:03 -040045
46 - name: Configure Buildkit
dependabot[bot]94f57072022-10-19 03:38:52 +000047 uses: docker/setup-buildx-action@v2.2.1
Mohammed Naser7e6654a2022-09-21 17:48:03 -040048
49 - name: Checkout project
dependabot[bot]519c1932022-10-05 04:37:24 +000050 uses: actions/checkout@v3.1.0
Mohammed Naser7e6654a2022-09-21 17:48:03 -040051
52 - name: Authenticate with Quay.io
dependabot[bot]eb9d0602022-10-13 03:35:16 +000053 uses: docker/login-action@v2.1.0
Mohammed Naser7e6654a2022-09-21 17:48:03 -040054 with:
55 registry: quay.io
56 username: ${{ secrets.QUAY_USERNAME }}
57 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
58
59 - name: Generate image tag
60 id: image_tag
61 run: |
62 echo ::set-output name=tag::$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')
63
64 - name: Build image
dependabot[bot]f0d16162022-10-14 03:39:12 +000065 uses: docker/build-push-action@v3.2.0
Mohammed Naser7e6654a2022-09-21 17:48:03 -040066 with:
67 context: .
68 cache-from: type=gha
69 cache-to: type=gha,mode=max
70 push: true
71 tags: |
72 quay.io/vexxhost/atmosphere:latest
73 quay.io/vexxhost/atmosphere:${{ steps.image_tag.outputs.tag }}