Skip to content

Commit cea164c

Browse files
authored
Merge pull request #12 from NujSuper/dev_test_prod
Dev test prod
2 parents f03bfeb + 6d70a74 commit cea164c

4 files changed

Lines changed: 49 additions & 12 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ on:
88

99
permissions:
1010
id-token: write
11-
contents: write
11+
contents: read
1212

1313
jobs:
14-
strategy:
15-
matrix:
16-
env: [dev, prod, test]
14+
build-deploy:
15+
strategy:
16+
matrix:
17+
env: [dev, test, prod]
1718
name: Build Docker
1819
runs-on: ubuntu-latest
1920
environment: ${{ matrix.env }}
2021
steps:
2122
- name: Checkout code
2223
uses: actions/checkout@v6
23-
with:
24-
ref: ${{ github.ref }}
2524

2625
- name: Configure AWS Credentials
2726
uses: aws-actions/configure-aws-credentials@v5
@@ -41,5 +40,5 @@ jobs:
4140
ECR_REPOSITORY: 'ssh_bastion'
4241
IMAGE_TAG: latest
4342
run: |
44-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.ref_name }} .
45-
docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags
43+
docker build -t "$ECR_REGISTRY"/"$ECR_REPOSITORY":latest -t "$ECR_REGISTRY"/"$ECR_REPOSITORY":${{ github.sha }} -t "$ECR_REGISTRY/$ECR_REPOSITORY":${{ github.ref_name }} .
44+
docker push "$ECR_REGISTRY/$ECR_REPOSITORY" --all-tags
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint Workflows
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
actionlint:
13+
name: actionlint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- name: Download actionlint
18+
id: get_actionlint
19+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
20+
shell: bash
21+
- name: Check workflow files
22+
run: ${{ steps.get_actionlint.outputs.executable }} -color
23+
shell: bash
24+
25+
yamllint:
26+
name: yamllint
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Run yamllint
31+
run: yamllint .github/workflows/

.github/workflows/pr.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ on:
44
pull_request:
55
workflow_call:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
docker-build:
912
name: Build Docker
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Checkout code
1316
uses: actions/checkout@v6
14-
with:
15-
ref: ${{ github.ref }}
1617

17-
- name: Build, tag, and push the image to Amazon ECR
18+
- name: Build Docker image (local only)
1819
id: build-image
1920
env:
2021
ECR_REGISTRY: local.test
2122
ECR_REPOSITORY: 'ssh_bastion'
2223
IMAGE_TAG: latest
2324
run: |
24-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
25+
docker build -t "$ECR_REGISTRY/$ECR_REPOSITORY:latest" .

.yamllint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: default
2+
rules:
3+
line-length:
4+
max: 200
5+
truthy:
6+
allowed-values: ['true', 'false', 'on', 'off']

0 commit comments

Comments
 (0)