Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 1 | name: publish |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: |
| 6 | - published |
| 7 | |
| 8 | jobs: |
| 9 | ansible-collection: |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - name: Checkout project |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 13 | uses: actions/checkout@v3 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 14 | |
| 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 Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 21 | uses: bruceadams/get-release@v1 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 22 | 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 Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 31 | uses: actions/upload-release-asset@v1 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 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 |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 44 | uses: docker/setup-qemu-action@v2 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 45 | |
| 46 | - name: Configure Buildkit |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 47 | uses: docker/setup-buildx-action@v2 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 48 | |
| 49 | - name: Checkout project |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 50 | uses: actions/checkout@v3 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 51 | |
| 52 | - name: Authenticate with Quay.io |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 53 | uses: docker/login-action@v2 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 54 | 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 Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 65 | uses: docker/build-push-action@v3 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 66 | 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 }} |