From d6f4ac9a1209d339418bcb408cdc52eead2045fa Mon Sep 17 00:00:00 2001 From: Evan Richardson Date: Sun, 4 Feb 2024 06:03:04 +0000 Subject: [PATCH] add publish workflow --- .gitea/workflows/demo.yaml | 20 -------------------- .gitea/workflows/publish.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 20 deletions(-) delete mode 100644 .gitea/workflows/demo.yaml create mode 100644 .gitea/workflows/publish.yaml diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index a4c800c..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: shared - steps: - - run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo " The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo " The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo " This job's status is ${{ job.status }}." - \ No newline at end of file diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..ed7ee92 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,26 @@ +name: Build and publish Image +run-name: ${{ gitea.actor }} is building py-eagle-mqtt image +on: + push: + tags: + - '*' + branches: + - '*' + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build Docker image + run: docker build -t harbor.evanshome.io/library/py-eagle-mqtt:latest ./Docker/ + + - name: Login to Harbor + run: docker login -u ${{ secrets.HARBOR_USERNAME }} -p ${{ secrets.HARBOR_PASSWORD }} harbor.evanshome.io + + - name: Push Docker image to Harbor + run: docker push harbor.evanshome.io/library/py-eagle-mqtt:latest + \ No newline at end of file