11name : Deploy
2- on :
3- push :
4- branches : [ master ]
5- workflow_dispatch :
2+
3+ on : push
4+
5+ env :
6+ REGISTRY : ghcr.io
7+ IMAGE_NAME : ${{ github.repository }}
8+ DEFAULT_BRANCH : ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
9+
610jobs :
7- deploy :
11+ build_or_push_image :
812 runs-on : ubuntu-latest
13+
914 steps :
10- - uses : actions/checkout@v2
11- - uses : dorny/paths-filter @v2
12- id : filter
13- with :
14- filters : |
15- payloads :
16- - 'app/services/gamebridge/payloads/structures/**'
17- - name : normal deploy
18- if : steps.filter.outputs.payloads == 'false'
19- uses : fjogeleit/http-request-action@v1
20- with :
21- # Request URL
22- url : https://metaconcord.metastruct.net/ci/reload
23- # Request Method
24- method : GET
25- bearerToken : ${{secrets.TOKEN}}
26- - name : deploy all
27- if : steps.filter.outputs.payloads == 'true'
28- uses : fjogeleit/http-request-action@v1
29- with :
30- # Request URL
31- url : https://metaconcord.metastruct.net/ci/reload?all=true
32- # Request Method
33- method : GET
34- bearerToken : ${{secrets.TOKEN }}
15+ - name : Checkout
16+ uses : actions/checkout @v2
17+
18+ - name : Docker Login
19+ 20+ with :
21+ registry : ${{ env.REGISTRY }}
22+ username : ${{ github.actor }}
23+ password : ${{ secrets.GITHUB_TOKEN }}
24+
25+ - name : Extract metadata (tags, labels) for Docker
26+ id : meta
27+ uses : docker/metadata-action@v3
28+ with :
29+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
30+ tags : |
31+ type=raw,value=latest,enable=${{ github.ref == env.DEFAULT_BRANCH }}
32+
33+ - name : Build and push Docker images
34+ 35+ with :
36+ context : .
37+ push : ${{ github.ref == env.DEFAULT_BRANCH }}
38+ tags : ${{ steps.meta.outputs.tags }}
39+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments