|
|
|
@@ -7,6 +7,9 @@ concurrency:
|
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
GHCR_TEST_IMAGE: ghcr.io/docker/login-action-test:ci-${{ github.sha }}
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
schedule:
|
|
|
|
@@ -22,7 +25,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Stop docker
|
|
|
|
|
run: |
|
|
|
|
@@ -46,7 +49,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
@@ -56,44 +59,75 @@ jobs:
|
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
logout: ${{ matrix.logout }}
|
|
|
|
|
|
|
|
|
|
dind:
|
|
|
|
|
push-ghcr:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
env:
|
|
|
|
|
DOCKER_CONFIG: $HOME/.docker
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ghcr.io
|
|
|
|
|
username: ${{ secrets.GHCR_USERNAME }}
|
|
|
|
|
password: ${{ secrets.GHCR_PAT }}
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
-
|
|
|
|
|
name: Build and push test image
|
|
|
|
|
run: |
|
|
|
|
|
docker buildx build --push -t "${GHCR_TEST_IMAGE}" - <<EOF
|
|
|
|
|
FROM scratch
|
|
|
|
|
LABEL org.opencontainers.image.title="docker/login-action CI test image"
|
|
|
|
|
LABEL org.opencontainers.image.description="Empty image used by CI to verify GHCR authentication."
|
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY}"
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
dind:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs:
|
|
|
|
|
- push-ghcr
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: read
|
|
|
|
|
env:
|
|
|
|
|
DOCKER_CONFIG: $HOME/.docker
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ghcr.io
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
-
|
|
|
|
|
name: DinD
|
|
|
|
|
uses: docker://docker:29.3@sha256:4d90f1f6c400315c2dba96d3ec93c01e64198395cbba04f79d12adce4f737029
|
|
|
|
|
with:
|
|
|
|
|
entrypoint: docker
|
|
|
|
|
args: pull ghcr.io/docker-ghactiontest/test
|
|
|
|
|
args: pull ${{ env.GHCR_TEST_IMAGE }}
|
|
|
|
|
-
|
|
|
|
|
name: Pull private image
|
|
|
|
|
name: Pull test image
|
|
|
|
|
run: |
|
|
|
|
|
docker image prune -a -f >/dev/null 2>&1
|
|
|
|
|
docker pull ghcr.io/docker-ghactiontest/test
|
|
|
|
|
docker pull "${GHCR_TEST_IMAGE}"
|
|
|
|
|
|
|
|
|
|
acr:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to ACR
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ${{ secrets.AZURE_REGISTRY_NAME }}.azurecr.io
|
|
|
|
|
registry: officialgithubactions.azurecr.io
|
|
|
|
|
username: ${{ secrets.AZURE_CLIENT_ID }}
|
|
|
|
|
password: ${{ secrets.AZURE_CLIENT_SECRET }}
|
|
|
|
|
|
|
|
|
@@ -108,13 +142,13 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Docker Hub
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
|
|
|
|
|
|
|
|
|
|
ecr:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
@@ -127,12 +161,12 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to ECR
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ${{ secrets.AWS_ACCOUNT_NUMBER }}.dkr.ecr.us-east-1.amazonaws.com
|
|
|
|
|
registry: 175142243308.dkr.ecr.us-east-1.amazonaws.com
|
|
|
|
|
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
|
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
|
|
|
|
|
@@ -147,7 +181,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Configure AWS Credentials
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
|
|
|
@@ -159,7 +193,34 @@ jobs:
|
|
|
|
|
name: Login to ECR
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ${{ secrets.AWS_ACCOUNT_NUMBER }}.dkr.ecr.us-east-1.amazonaws.com
|
|
|
|
|
registry: 175142243308.dkr.ecr.us-east-1.amazonaws.com
|
|
|
|
|
|
|
|
|
|
ecr-oidc:
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
id-token: write
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
os:
|
|
|
|
|
- ubuntu-latest
|
|
|
|
|
- windows-latest
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Configure AWS Credentials
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
|
|
|
|
with:
|
|
|
|
|
role-to-assume: arn:aws:iam::175142243308:role/official_gha_cicd_login_action
|
|
|
|
|
aws-region: us-east-1
|
|
|
|
|
-
|
|
|
|
|
name: Login to ECR
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: 175142243308.dkr.ecr.us-east-1.amazonaws.com
|
|
|
|
|
|
|
|
|
|
ecr-public:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
@@ -172,7 +233,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Public ECR
|
|
|
|
|
continue-on-error: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
@@ -195,7 +256,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Configure AWS Credentials
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
|
|
|
@@ -210,6 +271,34 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
registry: public.ecr.aws
|
|
|
|
|
|
|
|
|
|
ecr-public-oidc:
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
id-token: write
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
os:
|
|
|
|
|
- ubuntu-latest
|
|
|
|
|
- windows-latest
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Configure AWS Credentials
|
|
|
|
|
uses: aws-actions/configure-aws-credentials@acca2b1b2070338fb9fd1ca27ecee81d687e58e5 # v6.1.2
|
|
|
|
|
with:
|
|
|
|
|
role-to-assume: arn:aws:iam::175142243308:role/official_gha_cicd_login_action
|
|
|
|
|
aws-region: us-east-1
|
|
|
|
|
-
|
|
|
|
|
name: Login to Public ECR
|
|
|
|
|
continue-on-error: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: public.ecr.aws
|
|
|
|
|
|
|
|
|
|
ghcr:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
@@ -221,7 +310,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
@@ -241,7 +330,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitLab
|
|
|
|
|
uses: ./
|
|
|
|
@@ -261,12 +350,12 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Google Artifact Registry
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry: ${{ secrets.GAR_LOCATION }}-docker.pkg.dev
|
|
|
|
|
registry: us-east4-docker.pkg.dev
|
|
|
|
|
username: _json_key
|
|
|
|
|
password: ${{ secrets.GAR_JSON_KEY }}
|
|
|
|
|
|
|
|
|
@@ -281,7 +370,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Google Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
@@ -295,14 +384,14 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to registries
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
registry-auth: |
|
|
|
|
|
- username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
- username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
|
|
|
|
|
- registry: ghcr.io
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
@@ -318,7 +407,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to registries
|
|
|
|
|
uses: ./
|
|
|
|
@@ -339,7 +428,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to registries
|
|
|
|
|
id: login
|
|
|
|
@@ -350,8 +439,8 @@ jobs:
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
registry-auth: |
|
|
|
|
|
- username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
- username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
|
|
|
|
|
-
|
|
|
|
|
name: Check
|
|
|
|
|
run: |
|
|
|
|
@@ -371,13 +460,13 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Docker Hub
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
|
|
|
|
|
scope: '@push'
|
|
|
|
|
-
|
|
|
|
|
name: Print config.json files
|
|
|
|
@@ -401,13 +490,13 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to Docker Hub
|
|
|
|
|
uses: ./
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
|
|
|
|
|
scope: 'docker/buildx-bin@push'
|
|
|
|
|
-
|
|
|
|
|
name: Print config.json files
|
|
|
|
@@ -431,7 +520,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
@@ -462,7 +551,7 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
-
|
|
|
|
|
name: Checkout
|
|
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
|
-
|
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
|
uses: ./
|
|
|
|
|