-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 962 Bytes
/
build.yaml
File metadata and controls
41 lines (33 loc) · 962 Bytes
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
name: Build
on:
push:
branches:
- master
paths-ignore:
- charts/**
jobs:
docker:
runs-on: ubuntu-20.04
env:
REPO: ghcr.io/netsoc/docs
steps:
- uses: actions/checkout@v2
with:
# So that the build can see the history and note the update times
fetch-depth: 0
- name: Log into GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: vars
name: Generate build vars
run: |
SHA="${{ github.sha }}"
echo "::set-output name=tag::"${SHA:0:8}-$(date +%s)Z""
# Use plain Docker here, buildx misses .git
- name: Build
run: docker build -t "${{ env.REPO }}:${{ steps.vars.outputs.tag }}" -t "${{ env.REPO }}:latest" .
- name: Push
run: docker push --all-tags "$REPO"