-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (46 loc) · 1.51 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
#
# Nimbus
# CI
# Docker
#
name: Build and Publish Docker Containers
on: push
jobs:
publish-container:
name: "${{ matrix.container }}: Build & Publish Docker Container"
strategy:
fail-fast: false
matrix:
container:
- naiveproxy
runs-on: ubuntu-22.04
# add permissions needed to push containers to GHCR with GITHUB_TOKEN
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Log in to the GitHub Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- id: docker-metadata
name: "Gather metadata for tagging / labeling ${{ matrix.source }} Container"
uses: docker/[email protected]
with:
images: "ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}"
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
# set latest tag for default branch (main)
type=raw,value=latest,enable={{is_default_branch}}
- name: "Build and Push ${{ matrix.container }} Container to GitHub Container Registry"
uses: docker/[email protected]
with:
context: "docker/${{ matrix.container }}"
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
push: true