Skip to content

Commit ae9a6af

Browse files
committed
test v1 of docker image workflow
1 parent 600355b commit ae9a6af

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and publish Docker image to ghcr.io
2+
on:
3+
# publish on releases, e.g. v2.1.13 (image tagged as "2.1.13" - "v" prefix is removed)
4+
release:
5+
types: [published]
6+
7+
# publish on pushes to the main branch (image tagged as "latest")
8+
push:
9+
branches:
10+
- main
11+
- master
12+
# paths:
13+
# - "urNode-backend/**"
14+
# allow manual triggers
15+
workflow_dispatch:
16+
17+
jobs:
18+
docker_publish:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
# https://github.community/t/github-actions-repository-name-must-be-lowercase/184924
25+
- name: downcase REPO
26+
run: |
27+
echo "REPO_LC=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
28+
# https://github.com/marketplace/actions/push-to-ghcr
29+
- name: Build and publish a Docker image for ${{ github.repository }}
30+
uses: macbre/push-to-ghcr@master
31+
with:
32+
image_name: ${REPO_LC}-backend
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
# optionally push to the Docker Hub (docker.io)
35+
# docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }} # see https://hub.docker.com/settings/security

0 commit comments

Comments
 (0)