Skip to content

Commit

Permalink
adding a workflow for publishing frontend applications to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dafengzhen committed Mar 17, 2024
1 parent 96b2b28 commit 58ee3ce
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
path: ./docs/.vitepress/dist

deploy:
environment:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/youdeyiwu-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: Publishing Youdeyiwu Backend Application to Docker

on:
push:
Expand All @@ -9,6 +9,10 @@ on:
- main
workflow_dispatch:

concurrency:
group: server
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/youdeyiwu-web-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publishing Youdeyiwu Frontend Application to Docker

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: frontend
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
uses: docker/build-push-action@v4
with:
context: .
push: false
tags: dafengzhen/youdeyiwu-web:dev

publish:
needs: build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web
name: Publish
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: dafengzhen/youdeyiwu-web:dev

0 comments on commit 58ee3ce

Please sign in to comment.