-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.14 KB
/
image.yaml
File metadata and controls
42 lines (35 loc) · 1.14 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
name: Docker Build and Push
on:
push:
tags:
- "v*"
jobs:
BuildAndPush:
runs-on: ubuntu-latest
steps:
- name: Set up Go modules cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract tag name
run: |
tagname=${GITHUB_REF#refs/*/} && echo "TAG_NAME=${tagname#v}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: registry.uniproject.jp
username: ayane
password: ${{ secrets.HARBOR_TOKEN }}
- name: Build Docker image
run: docker build --progress=plain -t registry.uniproject.jp/ayane/payment-api:${{ env.TAG_NAME }} .
- name: Push Docker image
run: docker push registry.uniproject.jp/ayane/payment-api:${{ env.TAG_NAME }}