From 5785f1af82618e42654f9689c46efd5ba9d64b07 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Mon, 10 Jul 2023 11:51:45 +0200 Subject: [PATCH] setup basic action based ci (#3) #### :book: Summary testing semver #### :bookmark_tabs: Test Plan > :bulb: Select your test plan for the code changes. - [x] CI pipeline tests - [ ] Custom test - [ ] No test plan ##### Details / Justification #### :books: Additional Notes Co-authored-by: OCram85 Reviewed-on: https://gitea.ocram85.com/OCram85/swarmproxy/pulls/3 --- .gitea/workflows/deploy.yaml | 51 +++++++++++++++++++ .gitea/workflows/docker.yaml | 28 +++++----- .../{.deploy.yml => .deploy.yml.disabled} | 0 .woodpecker/{.next.yml => .next.yml.disabled} | 0 .woodpecker/{.test.yml => .test.yml.disabled} | 0 5 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 .gitea/workflows/deploy.yaml rename .woodpecker/{.deploy.yml => .deploy.yml.disabled} (100%) rename .woodpecker/{.next.yml => .next.yml.disabled} (100%) rename .woodpecker/{.test.yml => .test.yml.disabled} (100%) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..f2460ed --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,51 @@ +name: docker + +run-name: Container Image Deployment + +on: + push: + branches: + - 'master' + tags: + - 'v*' + +jobs: + build-container: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ocram85/swarmproxy + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - + name: Set up QEMU + uses: actions/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: actions/setup-buildx-action@v2 + - + name: Login to Gitea Package Registry + uses: actions/login-action@v2 + with: + registry: gitea.ocram85.com + username: ${{ secrets.USERNAME }} + #password: ${{ secrets.PASSWORD }} + password: ${{ secrets.TOKEN }} + - + name: Build and push + uses: actions/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + #tags: gitea.ocram85.com/ocram85/swarmproxy:next2 + diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index d44b20b..7643689 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -4,33 +4,35 @@ run-name: ${{ gitea.actor }} testing docker builder on: push: - branches: none #[ main ] - #paths: .github/workflows/1-actions-ci-cd-aks.yml + #branches: none #[ main ] pull_request: - branches: none # [ main ] + #branches: none # [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: build-container: runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + #- + # name: Set up QEMU + # uses: actions/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: actions/setup-buildx-action@v2 - name: Login to Gitea Package Registry - uses: docker/login-action@v2 + uses: actions/login-action@v2 with: registry: gitea.ocram85.com - username: ${{ secrets.GITEA_USERNAME }} - password: ${{ secrets.GITEA_TOKEN }} + username: ${{ secrets.USERNAME }} + #password: ${{ secrets.PASSWORD }} + password: ${{ secrets.TOKEN }} - name: Build and push - uses: docker/build-push-action@v4 + uses: actions/build-push-action@v4 with: - push: false #true - tags: gitea.ocram85.com/ocram85/swarmproxy:next + push: false + tags: gitea.ocram85.com/ocram85/swarmproxy:next2 diff --git a/.woodpecker/.deploy.yml b/.woodpecker/.deploy.yml.disabled similarity index 100% rename from .woodpecker/.deploy.yml rename to .woodpecker/.deploy.yml.disabled diff --git a/.woodpecker/.next.yml b/.woodpecker/.next.yml.disabled similarity index 100% rename from .woodpecker/.next.yml rename to .woodpecker/.next.yml.disabled diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml.disabled similarity index 100% rename from .woodpecker/.test.yml rename to .woodpecker/.test.yml.disabled