-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 907 Bytes
/
docker.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
name: docker build & push to registry
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
# use path context instead of git because we need git history for Vergen to work
context: .
push: true
tags: ghcr.io/arian8j2/forwarder:${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
env:
TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}