-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.13 KB
/
build-nonmain.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
name: Publish Docker image (Branches)
on:
push:
branches-ignore:
- 'main'
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
# Also replaces / with _ to make a valid tag name
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(TMP=${GITHUB_REF#refs/heads/}; echo ${TMP/\//_})"
id: extract_branch
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
tags: |
docker.pkg.github.com/londonhackspace/acnode-dashboard/acnode-dashboard:${{ steps.extract_branch.outputs.branch }}-${{ github.run_number }}