-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish containerised application to github container registry (#104)
* chore(approbation): add build workflow
- Loading branch information
Showing
5 changed files
with
72 additions
and
2 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,13 @@ | ||
dist | ||
build | ||
LICENSE | ||
*.md | ||
test | ||
.husky | ||
.github | ||
results | ||
assets | ||
.dockerignore | ||
.npmignore | ||
.gitignore | ||
|
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
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,44 @@ | ||
--- | ||
name: Package approbation image | ||
|
||
"on": | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Log in to the GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and export to local Docker | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: false | ||
load: true | ||
tags: vegaprotocol/approbation:local | ||
|
||
- name: Sanity check docker image | ||
run: | | ||
docker run --rm vegaprotocol/approbation:local version || docker run --rm vegaprotocol/approbation:local | ||
- name: Build and push to GitHub Docker registry | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/vegaprotocol/approbation:latest | ||
ghcr.io/vegaprotocol/approbation:${{github.ref_name}} | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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,12 @@ | ||
## Build with node 18 | ||
FROM node:18-bullseye-slim AS build | ||
WORKDIR /app | ||
COPY . . | ||
ENV NODE_ENV=production | ||
RUN npm install --omit=dev --no-audit | ||
|
||
## Run in distroless | ||
FROM astefanutti/scratch-node:18.10.0 | ||
COPY --from=build /app /app | ||
WORKDIR /app | ||
ENTRYPOINT ["node", "bin/approbation.js"] |
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