-
Notifications
You must be signed in to change notification settings - Fork 37
38 lines (31 loc) · 1.03 KB
/
build-js-calc-frontend.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
name: build-js-calc-frontend
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
working-directory: apps/js-calc-frontend
env:
IMAGE_NAME: "js-calc-frontend"
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run: |
docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/demos/$IMAGE_NAME
docker tag $IMAGE_NAME $IMAGE_ID:${GITHUB_RUN_ID}
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:${GITHUB_RUN_ID}
docker push $IMAGE_ID:latest