blob: d471c6cc2b19676d115b340df7436d1dccb7633c [file] [log] [blame]
Mohammed Naser1de55192023-04-28 17:13:35 -04001name: image
2
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8 release:
9 types:
10 - published
11
12jobs:
13 build:
14 runs-on: ubuntu-latest
15 steps:
16 - name: Checkout project
17 uses: actions/checkout@v3
18
19 - name: Install Earthly
20 uses: earthly/actions-setup@v1
21 with:
22 github-token: ${{ secrets.GITHUB_TOKEN }}
23
Mohammed Naser5c1338a2023-04-28 21:37:57 +000024 - name: Authenticate to Quay.io
25 uses: docker/login-action@v2
26 with:
27 registry: quay.io
28 username: ${{ secrets.QUAY_USERNAME }}
29 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
30
Mohammed Naser1de55192023-04-28 17:13:35 -040031 - name: Build image
32 run: earthly +image --tag ${{ github.sha }}
33 env:
34 EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
35
36 publish:
37 runs-on: ubuntu-latest
38 if: github.event_name == 'release'
39 needs:
40 - build
41 steps:
42 - name: Authenticate to Quay.io
43 uses: docker/login-action@v2
44 with:
45 registry: quay.io
46 username: ${{ secrets.QUAY_USERNAME }}
47 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
48
49 - name: Promote image
50 uses: akhilerm/tag-push-action@v2.1.0
51 with:
52 src: quay.io/vexxhost/atmosphere:${{ github.sha }}
53 dst: quay.io/vexxhost/atmosphere:${{ github.event.release.tag_name }}