-
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.
Add Dockerfile and GH action to push to Docker Hub
- Loading branch information
Showing
2 changed files
with
42 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,35 @@ | ||
name: publish-to-docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- "mistress" | ||
|
||
jobs: | ||
publish: | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
|
||
- name: Set version | ||
run: echo VERSION=`date +%Y%m%d` >> $GITHUB_ENV | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
platforms: linux/amd64 | ||
tags: ${{ secrets.DOCKER_USERNAME }}/pot_generator:latest,${{ secrets.DOCKER_USERNAME }}/pot_generator:${{ env.VERSION }} |
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,7 @@ | ||
FROM node:18.20.4-alpine3.20 | ||
RUN mkdir -p /opt/app | ||
WORKDIR /opt/app | ||
COPY package.json package-lock.json index.js LICENSE . | ||
RUN npm install | ||
EXPOSE 3000 | ||
CMD [ "node", "index.js" ] |