-
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.
* update
- Loading branch information
Showing
5 changed files
with
72 additions
and
48 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
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,51 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build_api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16.x" | ||
|
||
- name: build web | ||
run: | | ||
npm install | ||
npm run build | ||
working-directory: web | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
working-directory: api | ||
# use root folder docker | ||
- name: Build logbook image | ||
run: | | ||
docker build . --file Dockerfile -t ghcr.io/swuecho/logbook:${GITHUB_REF#refs/tags/} | ||
- name: Login to GitHub Container Registry | ||
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Push API image to GitHub Container Registry | ||
run: | | ||
docker push ghcr.io/swuecho/logbook:${GITHUB_REF#refs/tags/} | ||
docker tag ghcr.io/swuecho/logbook:${GITHUB_REF#refs/tags/} ghcr.io/swuecho/logbook:latest | ||
docker push ghcr.io/swuecho/logbook:latest | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: push to docker | ||
run: | | ||
docker tag ghcr.io/swuecho/logbook:${GITHUB_REF#refs/tags/} echowuhao/logbook:${GITHUB_REF#refs/tags/} | ||
docker tag ghcr.io/swuecho/logbook:${GITHUB_REF#refs/tags/} echowuhao/logbook:latest | ||
docker push echowuhao/logbook:${GITHUB_REF#refs/tags/} | ||
docker push echowuhao/logbook:latest |
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
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,8 @@ | ||
version: "3" | ||
services: | ||
web: | ||
image: echowuhao/logbook:latest | ||
environment: | ||
DATABASE_URL: db url | ||
ports: | ||
- "5000:5000" |