-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.57 KB
/
mgmt-push-image-ghcr.yaml
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
name: build_mgmt_image
on:
push:
branches:
- main
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ictsc-sachiko-v3
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set tags
uses: docker/metadata-action@v4
id: image-tag
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,prefix=mgmt-,value=latest
type=sha,prefix=mgmt-,format=short
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./
build-args: |
next_public_api_url=https://contest.mgmt.ictsc.net/api
next_public_answer_limit=20
next_public_site_name=${{ secrets.SITE_NAME }}
next_public_rule=${{ secrets.RULE }}
next_public_short_rule=${{ secrets.SHORT_RULE }}
next_public_recreate_rule=${{ secrets.RECREATE_RULE }}
push: true
tags: ${{ steps.image-tag.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max