Skip to content

Commit

Permalink
add: release action
Browse files Browse the repository at this point in the history
  • Loading branch information
SIY1121 committed Jan 23, 2021
1 parent 9d1e7ef commit 342facd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release image
on:
release:
types: [published]
jobs:
push-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
- name: Set Tag Name
run: echo "TAG_NAME=ghcr.io/twin-te/course-service:${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build
run: docker build . -t $TAG_NAME
- name: Push
run: docker push $TAG_NAME
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ RUN yarn build
FROM node:14-alpine
WORKDIR /usr/src/app

LABEL org.opencontainers.image.source https://github.com/twin-te/course-service

COPY --from=build-env /usr/src/app/dist ./dist
COPY --from=build-env /usr/src/app/generated ./generated
COPY --from=build-env /usr/src/app/package.json .
Expand Down

0 comments on commit 342facd

Please sign in to comment.