Skip to content

Commit e47afd8

Browse files
committed
Merge branch 'release/0_1_3'
2 parents c9d8b53 + 5cacc02 commit e47afd8

File tree

7 files changed

+84
-1
lines changed

7 files changed

+84
-1
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Items that don't need to be in a Docker image.
2+
# Anything not used by the build system should go here.
3+
.*
4+
Dockerfile
5+
README.md
6+
7+
# Artifacts that will be built during image creation.
8+
# This should contain all files created during `npm run build`.
9+
node_modules

.github/workflows/cd.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy
2+
3+
on:
4+
release:
5+
types: [prereleased, released]
6+
7+
concurrency:
8+
cancel-in-progress: false
9+
10+
env:
11+
ENVIRONMENT: ${{ github.event.action == 'prereleased' && 'staging' || 'production' }}
12+
13+
jobs:
14+
build-and-push:
15+
name: "Build and push docker image"
16+
runs-on: ubuntu-latest
17+
environment: ${{ env.ENVIRONMENT }}
18+
steps:
19+
- name: Print variables
20+
run: echo "${{ toJSON(vars)}}"
21+
22+
- name: Print env
23+
run: echo "${{ toJSON(env)}}"
24+
25+
- name: Print secrets
26+
run: echo "${{ toJSON(secrets)}}"
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build docker image (environment)
39+
run: |
40+
docker build -t ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }} -f Dockerfile .
41+
42+
- name: Push docker image to GitHub Container Registry (environment)
43+
run: |
44+
docker push ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }}
45+
46+
- name: Push docker image to GitHub Container Registry (production > staging)
47+
if: env.ENVIRONMENT == 'production'
48+
run: |
49+
docker push ghcr.io/killmenot/github-test-staging:${{ github.event.release.tag_name }}
50+
51+
52+
53+

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Test
2+
3+
on: [push, pull_request, release]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Print github context
10+
run: echo '${{ toJSON(github) }}'

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM nginx:1.25.4-alpine
2+
3+
COPY /static /usr/share/nginx/html
4+
RUN chown nginx.nginx /usr/share/nginx/html/ -R
5+
6+
EXPOSE 80

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ meet you and you may call me V.
1616
- feature2
1717
- hotfix1
1818
- feature3
19+
- feature4
20+
- feature5
21+
- feature6

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const test = (r) => r.test.bind(r);
33
module.exports = {
44
defaultIgnores: false,
55
extends: ['@commitlint/config-conventional'],
6-
ignores: [test(/Merge branch (.*?)(in|into) (.*)/)],
6+
ignores: [test(/Merge branch (.*?)/), test(/Merge branch (.*?)(in|into) (.*)/)],
77
};

static/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Hello World</h1>
2+
h1>

0 commit comments

Comments
 (0)