-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.5 KB
/
docker_image.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
name: Update the csp_reporter image
on:
workflow_dispatch:
schedule:
- cron: '20 5 1-31/7 * *'
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_alpine:
name: Prepare image, remove dev deps, push
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# - name: Check outputs
# run: echo ${{ steps.vars.outputs.sha_short }}
- name: Execute Dockerfile
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: |
jk779/csp_reporter:${{ steps.date.outputs.date }}-alpine-sha-${{ steps.vars.outputs.sha_short }}
jk779/csp_reporter:latest
labels: |
build_date=${{ steps.date.outputs.date }}
maintainer="jk779"
source=https://github.com/jk779/csp_reporter
vcs_ref=${{ github.sha }}