-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.27 KB
/
build.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
name: build-vs-workspace
on:
schedule:
- cron: "0 0 * * 4" # Thursdays at midnight UTC
push:
workflow_dispatch:
jobs:
push-ghcr:
name: Build and push image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate variables
id: vars
run: |
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
echo "name=${{ github.event.repository.name }}" >> $GITHUB_OUTPUT
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build image
run: |
docker build \
--tag ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.name }}:${{ steps.vars.outputs.date }} \
--tag ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.name }}:latest \
.
- name: Push to ghcr
run: |
docker push ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.name }}:${{ steps.vars.outputs.date }}
docker push ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.name }}:latest