diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index 868586f..b5cc37d 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -1,65 +1,44 @@ -name: Main - +name: Main Release on: push: branches: [master] - jobs: - lint: + hadolint: runs-on: ubuntu-latest + continue-on-error: true steps: - - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - name: Hadolint - uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d576162eba76ba5e5 # v3.3.0 - + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + - uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0 + with: + dockerfile: Dockerfile test: runs-on: ubuntu-latest - needs: lint steps: - - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@d7f5e7f509e45cec5cec5c76c4d5afdd7de93df5 # v4 - - name: Build image - run: docker build -t ci-image:${{ github.sha }} . - - name: Run tests - run: bash tests/test.sh ci-image:${{ github.sha }} - - push: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 + - run: docker build -t ci-image:${{ github.sha }} . + - run: bash tests/test.sh ci-image:${{ github.sha }} + build: + needs: [test] runs-on: ubuntu-latest - needs: test steps: - - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + - uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 + - run: docker build -t jcabillot/siege:${{ github.sha }} . + tag: + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@d7f5e7f509e45cec5cec5c76c4d5afdd7de93df5 # v4 - - name: Docker Metadata - id: meta - uses: docker/metadata-action@80c7e94dd9b9319bd5d67e4c5d0d6f05c5a2a2e9 # v6 - with: - images: jcabillot/siege - tags: | - type=raw,value=latest - type=sha - - name: Login to Docker Hub - uses: docker/login-action@650006c6eb7dba73a995c9c0bca3b95a915bee7 # v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@f9f3042f7278276550484b5f71a1d0ae9f3b07a # v7 - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - name: Bump version and push tag - uses: anothrNick/github-tag-action@ed44965e0dbd8abbbd2b46646a7a2b636c312fd8 # v1.75.0 + - name: Configure git auth + run: | + git remote set-url origin "https://x-access-token:${{ secrets.SA_TOKEN_ACTION_PUSH_TAGS }}@scm.cabillot.eu/perso/siege.git" + - uses: anothrNick/github-tag-action@4ed44965e0db8dab2b466a16da04aec3cc312fd8 # v1.75.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.SA_TOKEN_ACTION_PUSH_TAGS }} DEFAULT_BUMP: patch RELEASE_BRANCHES: master WITH_V: true - GIT_API_TAGGING: false \ No newline at end of file + GIT_API_TAGGING: false