Skip to content

Commit 3559ef5

Browse files
committed
initial commit
0 parents  commit 3559ef5

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Name of the workflow
2+
name: Build and Push AWS-CLI Image to GHCR
3+
4+
# Controls when the action will run.
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
9+
# Grant the GITHUB_TOKEN permissions to write to the container registry
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
steps:
18+
# 1. Checks-out your repository
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
# 2. Logs in to the GitHub Container Registry (GHCR)
23+
# Uses the automatically generated GITHUB_TOKEN for authentication
24+
- name: Log in to GHCR
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
# 3. Builds and pushes the Docker image to GHCR
32+
# The image name is dynamically set to ghcr.io/OWNER/REPO_NAME
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
push: true
38+
tags: ghcr.io/${{ github.repository }}:latest

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM docker:latest
2+
3+
RUN apk update \
4+
&& apk add --no-cache \
5+
aws-cli \
6+
openssh-client \
7+
&& rm -rf /var/cache/apk/*

0 commit comments

Comments
 (0)