-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.84 KB
/
release_docker.yml
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
name: Release Docker
on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
required: true
type: boolean
default: true
description: 'DryRun?'
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
build-docker:
runs-on: ubuntu-latest
name: Build Dockers
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'
cache-dependency-path: |
package-lock.json
- name: Setting env var
id: env_var
shell: bash
run: |
echo "::set-output name=VERSION::$(node -e 'console.log(require("./package.json").version)')"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
# To push to github registry
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
- name: Set up Docker QEMU for arm64 docker builds
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build Image
uses: docker/[email protected]
with:
file: Dockerfile
context: .
platforms: linux/amd64 # buildx does not support multi-arch load
push: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true') }}
tags: |
ghcr.io/bodinsamuel/renovate-automatic-branch:latest
ghcr.io/bodinsamuel/renovate-automatic-branch:${{ steps.env_var.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.env_var.outputs.VERSION }}