From a06a79aae40219aca7f7f6551db3af043e86f601 Mon Sep 17 00:00:00 2001 From: kevinlee-06 Date: Tue, 21 Jan 2025 00:10:13 +0800 Subject: [PATCH] Add GitHub Actions workflow for building and publishing Docker images on unstable branch --- .github/workflows/publish-ghcr-unstable.yaml | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publish-ghcr-unstable.yaml diff --git a/.github/workflows/publish-ghcr-unstable.yaml b/.github/workflows/publish-ghcr-unstable.yaml new file mode 100644 index 0000000..5f28464 --- /dev/null +++ b/.github/workflows/publish-ghcr-unstable.yaml @@ -0,0 +1,26 @@ +name: Docker Image CI for Unstable Branch + +on: + push: + branches: + - unstable + pull_request: + branches: + - unstable + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build and push + run: | + export TZ="Asia/Taipei" + VERSION=$(date +'%Y-%m-%d.%H.%M.%S') + docker login ghcr.io -u kevinlee-06 -p ${{secrets.GH_PAT}}; + docker build -t ghcr.io/kevinlee-06/linklie:${VERSION} . + docker tag ghcr.io/kevinlee-06/linklie:${VERSION} ghcr.io/kevinlee-06/linklie:unstable + docker push ghcr.io/kevinlee-06/linklie:${VERSION} + docker push ghcr.io/kevinlee-06/linklie:unstable \ No newline at end of file