diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index f35a097..25e6d04 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,23 +1,34 @@ name: ci -run-name: docker pipeline - on: push: - branches: [ '*' ] - tags-ignore: [ '*' ] + branches: + - 'main' + tags: + - 'v*' pull_request: - branches: [ main ] + branches: + - 'main' + jobs: - test-build: + docker: runs-on: ubuntu-latest container: image: catthehacker/ubuntu:act-latest steps: - #- - # name: Set up QEMU - # uses: actions/setup-qemu-action@v2 + - + name: Docker meta + id: meta + uses: actions/metadata-action@v4 + with: + images: | + gitea.ocram85.com/ocram85/swarmproxy + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} - name: Set up Docker Buildx uses: actions/setup-buildx-action@v2 @@ -33,5 +44,6 @@ jobs: name: Build and push uses: actions/build-push-action@v4 with: - push: false - tags: gitea.ocram85.com/ocram85/swarmproxy:next + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml deleted file mode 100644 index 1c75bb0..0000000 --- a/.gitea/workflows/deploy.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: deployment - -run-name: tag based container build and push - -on: - push: - branches: - - 'master' - tags: - - 'v*' - -jobs: - deployment-job: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - steps: - - - name: Docker meta - id: meta - uses: actions/metadata-action@v4 - with: - images: | - gitea.ocram85.com/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: - 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/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..c58dac3 --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,29 @@ +name: test + +run-name: docker pipeline + +on: [ 'push' ] + +jobs: + docker: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - + 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.TOKEN }} + - + name: Build and push + uses: actions/build-push-action@v4 + with: + push: false + #tags: gitea.ocram85.com/ocram85/swarmproxy:next + tags: ocram85/swarmproxy:test