-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.1 KB
/
Copy pathdocker-release.yml
File metadata and controls
43 lines (34 loc) · 1.1 KB
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
39
40
41
42
43
name: Build and Push Docker Image on Release Tag
on:
push:
tags:
- 'release*'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag name
id: extract_tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build Docker image with both tags
run: |
docker build \
-f src/GitcgNetCord.MainApp/Dockerfile \
-t ghcr.io/${{ github.repository }}:${{ env.TAG }} \
-t ghcr.io/${{ github.repository }}:latest \
.
- name: Push Docker image (version tag)
run: docker push ghcr.io/${{ github.repository }}:${{ env.TAG }}
- name: Push Docker image (latest tag)
run: docker push ghcr.io/${{ github.repository }}:latest