-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP add build and publish image workflow, add Dockerfile
- Loading branch information
1 parent
e0c037f
commit 699eac5
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build and publish image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-test-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: checkout | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
name: push-container-image | ||
with: | ||
image: gepardec-gamertrack-frontend | ||
registry: ghcr.io | ||
username: ${{ github.repository }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# if the branch is main, add the latest tag | ||
addLatest: ${{ github.ref == 'refs/heads/main' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . /usr/src/app | ||
|
||
RUN npm install -g @angular/cli | ||
|
||
RUN npm install | ||
|
||
EXPOSE 4200 | ||
|
||
CMD ["ng", "serve", "--host", "0.0.0.0"] |