-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.15 KB
/
build-latest.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build Latest
on:
workflow_dispatch:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 1
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/szinn/wordacle
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest
type=sha
# - name: Setup workflow Variables
# id: vars
# shell: bash
# run: |-
# VERSION="latest"
# if test "$GITHUB_EVENT_NAME" == "workflow_dispatch"; then
# VERSION=$(cat VERSION)
# fi
# echo "::set-output name=version::$VERSION"
# echo "::set-output name=tag_version::tesla-spy:$VERSION"
# - name: Setup QEMU
# uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Build container image
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
with:
# build-args: |-
# VERSION=${{ steps.vars.outputs.version }}
context: .
platforms: linux/amd64 # load does not support muti-arch https://github.com/docker/buildx/issues/290
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max