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

Use dev harbor for staging images #28

Closed
wants to merge 4 commits into from
Closed
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
22 changes: 15 additions & 7 deletions .github/workflows/build_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,29 @@ jobs:
matrix:
image: ${{ fromJson(needs.setup.outputs.images) }}
steps:
- name: Free up additional space
run : |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
Comment on lines +32 to +35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better:

Suggested change
- name: Free up additional space
run : |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: jlumbroso/free-disk-space@v1.3.1
with:
docker-images: false
large-packages: false

or

Suggested change
- name: Free up additional space
run : |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: true
docker-images: false
large-packages: false

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - I didn't realise there was an action now to handle this
I'll put in another commit once we get test.harbor back up to give us a target to push to

- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub # increase pull rate limit
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Harbor
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: harbor.stfc.ac.uk
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Login to Test Harbor
uses: docker/login-action@v3
with:
registry: test.harbor.stfc.ac.uk
username: ${{ secrets.TEST_HARBOR_USERNAME }}
password: ${{ secrets.TEST_HARBOR_TOKEN }}
- name: Build & push to prod
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v3
Expand All @@ -53,14 +63,12 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
uses: docker/build-push-action@v3
with:
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
context: "{{defaultContext}}:${{ matrix.image }}"
tags: "harbor.stfc.ac.uk/stfc-cloud-staging/${{ matrix.image }}:${{ needs.setup.outputs.sha }}"
tags: "test.harbor.stfc.ac.uk/stfc-cloud-staging/${{ matrix.image }}:${{ needs.setup.outputs.sha }}"
- name: Inform of tagged name
if: ${{ github.ref != 'refs/heads/master' }}
run: echo "::notice title=published::harbor.stfc.ac.uk/stfc-cloud-staging/${{ matrix.image }}:${{ needs.setup.outputs.sha }}"
run: echo "::notice title=published::test.harbor.stfc.ac.uk/stfc-cloud-staging/${{ matrix.image }}:${{ needs.setup.outputs.sha }}"
finished: # convenient single job name to apply branch protection to
needs: build
runs-on: ubuntu-latest
Expand Down
Loading