Skip to content

Commit

Permalink
adding a workflow for publishing backend applications to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dafengzhen committed Mar 17, 2024
1 parent d8e67f7 commit 96b2b28
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Deploy Youdeyiwu Docs site to Pages
on:
push:
branches: [ main ]

pull_request:
branches:
- main
workflow_dispatch:

permissions:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/youdeyiwu-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ci

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

jobs:
build:
runs-on: ubuntu-latest
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:dev

publish:
needs: build
runs-on: ubuntu-latest
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:dev

0 comments on commit 96b2b28

Please sign in to comment.