Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows to use GH Container Registry #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/push-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ jobs:
uses: actions/checkout@v2

- name: Build image
run: docker image build . --file Dockerfile --tag $ORGANIZATION/$IMAGE_NAME:$IMAGE_TAG
run: docker image build . --file Dockerfile --tag $ORGANIZATION/$IMAGE_NAME:$IMAGE_TAG --tag ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$IMAGE_TAG

- name: Login to Docker Hub registry
run: echo '${{ secrets.DOCKERHUB_PASS }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

- name: Push image to registry
- name: Push image to Docker Hub registry
run: docker push $ORGANIZATION/$IMAGE_NAME:$IMAGE_TAG

# CR_PAT contains a PAT with `write:packages` and `read:packages` scopes
- name: Log into GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image to GitHub Container registry
run: docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$IMAGE_TAG

- name: Save image
run: docker image save -o $IMAGE_NAME-$IMAGE_TAG.tar $ORGANIZATION/$IMAGE_NAME:$IMAGE_TAG

Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,21 @@ jobs:
run: echo "::set-env name=IMAGE_RELEASE_TAG::release-${RELEASE_TAG}_terraform-${{ matrix.tf_version }}_azcli-${{ matrix.azcli_version }}"

- name: Build image
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=${{ matrix.tf_version }} --build-arg AZURE_CLI_VERSION=${{ matrix.azcli_version }} --tag ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}
run: docker image build . --file Dockerfile --build-arg TERRAFORM_VERSION=${{ matrix.tf_version }} --build-arg AZURE_CLI_VERSION=${{ matrix.azcli_version }} --tag ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG} --tag ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}

- name: Login to Docker Hub registry
run: echo '${{ secrets.DOCKERHUB_PASS }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

- name: Push image to registry
- name: Push image to Docker Hub registry
run: docker push ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}

# CR_PAT secret contains a PAT with `write:packages` and `read:packages` scopes
- name: Log into GitHub Container Registry
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image to GitHub Container registry
run: docker push ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}

- name: Save image
run: docker image save -o ${IMAGE_NAME}-${IMAGE_RELEASE_TAG}.tar ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}

Expand Down