Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
chore: Update Dockerfile to use Maven for building and deploying the …
Browse files Browse the repository at this point in the history
…application
  • Loading branch information
suyiiyii committed May 7, 2024
1 parent e3c7d54 commit c48f2ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
# 定义镜像标签,为"commit id"
IMAGE_TAG: ${{ github.sha }}

steps:
- uses: actions/checkout@v4
- name: Build the Docker imag
run: docker build . --file Dockerfile --tag ${{ secrets.REPOSITORY }}:$(date +%s)
run: docker build . --file Dockerfile --tag ${{ secrets.REPOSITORY }}:${{ env.IMAGE_TAG }}
- name: Login to Registry
run: echo "${{ secrets.REPOSITORY_PASSWORD }}" | docker login -u "${{ secrets.REPOSITORY_USERNAME }}" --password-stdin ${{ secrets.REGISTRY }}
- name: Push the Docker image
run: docker push ${{ secrets.REPOSITORY }}:$(date +%s)

run: docker push ${{ secrets.REPOSITORY }}:${{ env.IMAGE_TAG }}

0 comments on commit c48f2ad

Please sign in to comment.