blob: f454b7f42eb9d0362906ae48a844c7e10e61457e [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
Mohammed Naser88cb2762023-01-18 03:28:21 +000013 uses: actions/checkout@v3
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
Mohammed Naser88cb2762023-01-18 03:28:21 +000021 uses: bruceadams/get-release@v1
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
Mohammed Naser88cb2762023-01-18 03:28:21 +000031 uses: actions/upload-release-asset@v1
Mohammed Naser7e6654a2022-09-21 17:48:03 -040032 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
Mohammed Naser88cb2762023-01-18 03:28:21 +000044 uses: docker/setup-qemu-action@v2
Mohammed Naser7e6654a2022-09-21 17:48:03 -040045
46 - name: Configure Buildkit
Mohammed Naser88cb2762023-01-18 03:28:21 +000047 uses: docker/setup-buildx-action@v2
Mohammed Naser7e6654a2022-09-21 17:48:03 -040048
49 - name: Checkout project
Mohammed Naser88cb2762023-01-18 03:28:21 +000050 uses: actions/checkout@v3
Mohammed Naser7e6654a2022-09-21 17:48:03 -040051
52 - name: Authenticate with Quay.io
Mohammed Naser88cb2762023-01-18 03:28:21 +000053 uses: docker/login-action@v2
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
Mohammed Naser88cb2762023-01-18 03:28:21 +000065 uses: docker/build-push-action@v3
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 }}