diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8417088 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: Release Package + +on: + push: + branches: + - main + - workflow + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build the new image + run: docker build . -t ghcr.io/zeuswpi/zauth:${{ github.sha }} + - name: Login to the container registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin + - name: Tag the new image with latest + run: docker tag ghcr.io/zeuswpi/zauth:${{ github.sha }} ghcr.io/zeuswpi/zauth:latest + - name: Push the new image + run: docker push --all-tags ghcr.io/zeuswpi/zauth diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2f51fdc..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Release Package - -on: - push: - tags: - - 'v*' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Parse tag - id: parse_tag - run: "echo ${{ github.ref }} | sed 's#^refs/tags/v#::set-output name=version::#'" - - name: Create release - id: create_release - uses: release-drafter/release-drafter@v5 - with: - name: v${{ steps.parse_tag.outputs.version }} - tag: v${{ steps.parse_tag.outputs.version }} - version: v${{ steps.parse_tag.outputs.version }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build the new image - run: docker build . -t ghcr.io/zeuswpi/zauth:${{ steps.parse_tag.outputs.version }} - - name: Login to the container registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - - name: Tag the new image with latest - run: docker tag ghcr.io/zeuswpi/zauth:${{ steps.parse_tag.outputs.version }} ghcr.io/zeuswpi/zauth:latest - - name: Push the new image - run: docker push --all-tags ghcr.io/zeuswpi/zauth