blob: aadfe03cb8ecf46a945bfc6e8c6a5b6e634cac09 [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
13 uses: actions/checkout@v3.0.2
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
21 uses: bruceadams/get-release@v1.2.2
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
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
44 uses: docker/setup-qemu-action@v2.0.0
45
46 - name: Configure Buildkit
47 uses: docker/setup-buildx-action@v2.0.0
48
49 - name: Checkout project
50 uses: actions/checkout@v3.0.2
51
52 - name: Authenticate with Quay.io
53 uses: docker/login-action@v2.0.0
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
65 uses: docker/build-push-action@v3.1.1
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 }}