-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-docker-general-service.yaml
More file actions
61 lines (50 loc) · 1.43 KB
/
push-docker-general-service.yaml
File metadata and controls
61 lines (50 loc) · 1.43 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy general-service image to GHCR
on:
push:
tags:
- 'general-service/v*.*.*'
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./general-service
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: general-service/go.mod
- name: Run tests
run: go test ./...
docker-publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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 version from tag
id: extract
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=$(echo "$TAG" | cut -d/ -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./general-service
file: ./general-service/Dockerfile
push: true
tags: ghcr.io/qubic/qubic-aggregation-service:${{ steps.extract.outputs.version }}