-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.51 KB
/
docker-build.yaml
File metadata and controls
52 lines (46 loc) · 1.51 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
name: Docker Image CI
# publish new image when changes are made to the
# Dockerfile, main.go, or any files in the templates directory
on:
push:
paths:
- 'Dockerfile'
- 'main.go'
- 'templates/**'
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
IMAGE_NAME: vault-sdk-go-app
jobs:
build:
name: Build docker images
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: checkout code
uses: actions/checkout@v5
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN_PACKAGES }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}
tags: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: Build and push Landing Page Docker image
uses: docker/build-push-action@v7
with:
file: ./Dockerfile
context: .
push: true
github-token: ${{ secrets.GH_TOKEN_PACKAGES }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}