Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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: 32 additions & 0 deletions .github/actions/push-container/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Push Container
description: Push a Container

inputs:
registry:
description: Server address of Docker registry.
required: true
username:
description: Username used to login.
required: true
password:
description: Password or PAT used to login.
required: true

name:
description: The name of the image to push.
required: true
tag:
description: The tag of the image to push.
required: true

runs:
using: "composite"
steps:
- uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- run: |
docker push ${{ inputs.registry }}/${{ inputs.name }}:${{ inputs.tag }}
11 changes: 4 additions & 7 deletions .github/workflows/llvm-project-epoch-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ jobs:
- name: Test statically linked clang
run: bash ci/test-clang.sh

- name: Login to ghcr.io

- uses: ./.github/actions/push-container
if: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image to ghcr.io
if: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
run: |
docker push ghcr.io/clangbuiltlinux/llvm-project:stage2
name: clangbuiltlinux/llvm-project
tag: stage2
11 changes: 4 additions & 7 deletions .github/workflows/llvm-project-epoch-two.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ jobs:
- name: Test statically linked clang
run: bash ci/test-clang.sh

- name: Login to ghcr.io

- uses: ./.github/actions/push-container
if: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image to ghcr.io
if: ${{ github.repository_owner == 'ClangBuiltLinux' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
run: |
docker push ghcr.io/clangbuiltlinux/llvm-project:stage2
name: clangbuiltlinux/llvm-project
tag: stage2