-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (35 loc) · 1.02 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: publish
on:
release:
types: [published]
env:
TEST_TAG: ghcr.io/immobiliare/inca:test
LATEST_TAG: ghcr.io/immobiliare/inca:latest
NEW_TAG: ghcr.io/immobiliare/inca:${{ github.event.release.tag_name }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_SRE_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
- name: Test Docker Image
run: |
docker run --rm ${{ env.TEST_TAG }}
- name: Build and push Docker Image
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ env.NEW_TAG }}, ${{ env.LATEST_TAG }}
push: true