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

chore(IDX): updating base images workflow #366

Merged
merged 10 commits into from
Jul 16, 2024
Merged
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
32 changes: 18 additions & 14 deletions .github/workflows/container-base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
name: Container IC Base Images

on:
# TODO: Enable prior to migration
# schedule:
# - cron: "0 8 * * 4"
schedule:
- cron: "0 8 * * 4"
workflow_dispatch:
# TODO: Change to pull_request_target
pull_request:
paths:
- '.github/workflows/container-base-images.yml'
- '**/Dockerfile.base'
- '**/packages.common'
- '**/packages.dev'
Expand All @@ -21,6 +20,7 @@ concurrency:

permissions:
pull-requests: write
packages: write
contents: write

jobs:
Expand Down Expand Up @@ -70,11 +70,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@a530e948adbeb357dbca95a7f8845d385edf4438 # v3

- name: Login to Docker Hub
- name: Login to GHCR
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf # v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Base Image
uses: docker/build-push-action@eb539f44b153603ccbfbd98e2ab9d4d0dcaf23a4 # v5
Expand All @@ -83,15 +84,15 @@ jobs:
context: ${{ matrix.CONTEXT }}
file: ${{ matrix.CONTEXT }}/Dockerfile.base
push: ${{ github.ref_name == 'master' }}
tags: dfinity/${{ matrix.IMAGE }}:${{ env.DATE }}
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.IMAGE }}:${{ env.DATE }}
build-args: ${{ matrix.BUILD_ARGS }}

- name: Collect SHA256 Digest
shell: bash
run: |
set -xeuo pipefail
mkdir -p "$(dirname artifacts/${{ matrix.REFFILE }})"
echo docker.io/dfinity/${{matrix.IMAGE}}@${{ steps.build-base-image.outputs.imageid }} \
echo ghcr.io/dfinity/${{matrix.IMAGE}}@${{ steps.build-base-image.outputs.imageid }} \
> artifacts/${{ matrix.REFFILE }}

- name: Upload SHA256 Digest Artifact
Expand Down Expand Up @@ -133,10 +134,13 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
# TODO: change to master prior to migration
base: mirroring
token: ${{ secrets.IDX_PUSH_TO_PR }}
base: master
branch: base-image-refs-update-${{ env.DATE }}
delete-branch: true
title: Update Base Image Refs [${{ env.DATE }}]
body: Updating base container image references.
draft: true
title: "chore: Update Base Image Refs [${{ env.DATE }}]"
body: |
Updating base container image references.

Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
draft: false
1 change: 1 addition & 0 deletions .github/workflows/slack-workflow-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- Schedule Daily
- Schedule Weekly
- Release Testing
- Container IC Base Images

jobs:
slack-workflow-run:
Expand Down