Skip to content

Commit

Permalink
Merge pull request #40 from kahootali/remove-deprecated-steps
Browse files Browse the repository at this point in the history
remove deprecated steps and update pipeline versions
  • Loading branch information
kahootali authored Nov 1, 2023
2 parents 670659c + 4f198ca commit 2241afb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ jobs:
IMAGE_ID=$IMAGE_NAME:$IMAGE_TAG
IMAGE_REPO=$REGISTRY/$IMAGE_ID
echo "Image: $IMAGE_REPO"
echo "::set-output name=image::$IMAGE_REPO"
echo "::set-output name=image_name::$IMAGE_NAME"
echo REPO=$IMAGE_NAME >> $GITHUB_ENV
echo IMAGE=$(echo "$REGISTRY/$IMAGE_ID") >> $GITHUB_ENV
echo "image=$IMAGE_REPO" >>$GITHUB_OUTPUT
echo "image_name=$IMAGE_NAME" >>$GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -68,17 +66,15 @@ jobs:
run: |
echo "Image from Output: ${{ steps.generate_vars.outputs.image }}"
echo "Repo from Output: ${{ steps.generate_vars.outputs.image_name }}"
echo "Image from Env: ${{ env.IMAGE }}"
echo "Repo from Env: ${{ env.REPO }}"
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5.0.0
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: ${{ env.IMAGE }}
tags: ${{ steps.generate_vars.outputs.image }}

- name: Push tag
uses: anothrNick/[email protected]
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
go build -v .
- name: Initialize Pipeline
uses: mshick/add-pr-comment@v2
uses: mshick/add-pr-comment@v2.8.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -47,17 +47,15 @@ jobs:
IMAGE_ID=$IMAGE_NAME:$IMAGE_TAG
IMAGE_REPO=$REGISTRY/$IMAGE_ID
echo "Image: $IMAGE_REPO"
echo "::set-output name=image::$IMAGE_REPO"
echo "::set-output name=image_name::$IMAGE_NAME"
echo REPO=$IMAGE_NAME >> $GITHUB_ENV
echo IMAGE=$(echo "$REGISTRY/$IMAGE_ID") >> $GITHUB_ENV
echo "image=$IMAGE_REPO" >>$GITHUB_OUTPUT
echo "image_name=$IMAGE_NAME" >>$GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -66,29 +64,27 @@ jobs:
run: |
echo "Image from Output: ${{ steps.generate_vars.outputs.image }}"
echo "Repo from Output: ${{ steps.generate_vars.outputs.image_name }}"
echo "Image from Env: ${{ env.IMAGE }}"
echo "Repo from Env: ${{ env.REPO }}"
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5.0.0
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: ${{ env.IMAGE }}
tags: ${{ steps.generate_vars.outputs.image }}

- name: Comment on PR
uses: mshick/add-pr-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '@${{ github.actor }} Image is available for testing. `docker pull ${{ env.IMAGE }}`'
message: '@${{ github.actor }} Image is available for testing. `docker pull ${{ steps.generate_vars.outputs.image }}`'
allow-repeats: false

- name: Notify Failure
if: failure()
uses: mshick/add-pr-comment@v1
uses: mshick/add-pr-comment@v2.8.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down

0 comments on commit 2241afb

Please sign in to comment.