Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
potongren committed Jan 6, 2024
1 parent 2dbce65 commit 91ec49c
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
files: |
staging/*.war
# 构建Docker Image
build-And-Push-Docker-Image:
# 在 Ubuntu 上运行
runs-on: ubuntu-latest
steps:
# git checkout 代码
- name: Checkout
uses: actions/checkout@v2
# 设置 QEMU, 后面 docker buildx 依赖此.
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -51,7 +43,7 @@ jobs:
# 通过 git 命令获取当前 tag 信息, 存入环境变量 APP_VERSION
- name: Generate App Version
run: echo "APP_VERSION=$(curl --silent "https://api.github.com/repos/yajuhua/podcast2/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_ENV

# 登录 docker hub
- name: Login to DockerHub
uses: docker/login-action@v1
Expand All @@ -62,18 +54,14 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PWD }}

# 下载最新release
# - name: Download lastest release
# run: wget "https://github.com/yajuhua/podcast2/releases/download/${{ env.APP_VERSION }}/podcast2.war"

# 解压podcast2.war
- name: unzip podcast2.war
run: unzip staging/podcast2.war -d ./podcast2

# 构建 Docker 并推送到 Docker hub
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yajuhua/podcast2:latest
run: docker build . --file Dockerfile --tag yajuhua/podcast2:latest

# 推送到docker hub
- name: Push Docker images
run: docker push yajuhua/podcast2:latest
run: docker push yajuhua/podcast2:latest

0 comments on commit 91ec49c

Please sign in to comment.