This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
forked from keithweaver/aws-s3-github-action
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build new image with latest amazon/aws-cli:2.13.4
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build & push image workflow | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: Reference to build image from. `master` will push the `latest` tag. | ||
type: string | ||
required: false | ||
default: master | ||
env: | ||
REGISTRY: ghcr.io # Using GH Packages for hosting public images | ||
IMAGE_NAME: ${{ github.repository }} | ||
LATEST: ${{ inputs == null && github.ref_name == 'master' || inputs.ref == 'master' }} | ||
|
||
jobs: | ||
build-push-image: | ||
name: Build & push image | ||
runs-on: eks-runner | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,enable=true,priority=100,prefix=,suffix=_${{ github.run_number }},format=short | ||
type=raw,value=latest,enable=${{env.LATEST}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3.3.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters