Skip to content

Commit a5447d5

Browse files
authored
Merge pull request #6 from NujSuper/master
Master
2 parents eedbf07 + 6929589 commit a5447d5

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "docker" # See documentation for possible values
9+
directories:
10+
- "/"
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"

.github/workflows/dev.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
docker-build:
11+
name: Build Docker
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v6
16+
with:
17+
ref: ${{ github.ref }}
18+
19+
- name: Configure AWS Credentials
20+
uses: aws-actions/configure-aws-credentials@v5
21+
with:
22+
aws-region: 'ap-southeast-2'
23+
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/github-nuj-repository-access
24+
role-session-name: NujPlatformAPISession
25+
26+
- name: Login to Amazon ECR
27+
id: login-ecr
28+
uses: aws-actions/amazon-ecr-login@v2
29+
30+
- name: Build, tag, and push the image to Amazon ECR
31+
id: build-image
32+
env:
33+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
34+
ECR_REPOSITORY: 'ssh_bastion'
35+
IMAGE_TAG: latest
36+
run: |
37+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.ref_name }} .
38+
docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags

.github/workflows/pr.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build Docker Image
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
7+
jobs:
8+
docker-build:
9+
name: Build Docker
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v6
14+
with:
15+
ref: ${{ github.ref }}
16+
17+
- name: Build, tag, and push the image to Amazon ECR
18+
id: build-image
19+
env:
20+
ECR_REGISTRY: local.test
21+
ECR_REPOSITORY: 'ssh_bastion'
22+
IMAGE_TAG: latest
23+
run: |
24+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .

0 commit comments

Comments
 (0)