-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.1 KB
/
build-and-publish.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
name: "Build & Publish"
on:
push:
branches:
- main
workflow_dispatch: ~
jobs:
build:
runs-on: ubuntu-latest
name: "🧰 Build Docker Image"
steps:
- name: "🚦 Setup BuildX Environment"
uses: docker/setup-buildx-action@v1
- name: "🔐 Login to GitHub Container Registry"
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_HOSTNAME }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: "📩 Checkout Project"
uses: actions/checkout@v2
# https://github.com/docker/build-push-action/issues/37
# not using ::set-env because ACTIONS_ALLOW_UNSECURE_COMMANDS = False
- name: "⬇️ Lowercasing Target"
run: |
echo GHCR_PATH=$(echo "${REPOSITORY}" | tr '[:upper:]' '[:lower:]') >> ${GITHUB_ENV}
env:
REPOSITORY: ${{ github.repository }}
- name: "🧰 Build Docker Image"
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.REGISTRY_HOSTNAME }}/${{ env.GHCR_PATH }}:latest