-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
1 deletion.
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,9 @@ | ||
# Items that don't need to be in a Docker image. | ||
# Anything not used by the build system should go here. | ||
.* | ||
Dockerfile | ||
README.md | ||
|
||
# Artifacts that will be built during image creation. | ||
# This should contain all files created during `npm run build`. | ||
node_modules |
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: Deploy | ||
|
||
on: | ||
release: | ||
types: [prereleased, released] | ||
|
||
concurrency: | ||
cancel-in-progress: false | ||
|
||
env: | ||
ENVIRONMENT: ${{ github.event.action == 'prereleased' && 'staging' || 'production' }} | ||
|
||
jobs: | ||
build-and-push: | ||
name: "Build and push docker image" | ||
runs-on: ubuntu-latest | ||
environment: ${{ env.ENVIRONMENT }} | ||
steps: | ||
- name: Print variables | ||
run: echo "${{ toJSON(vars)}}" | ||
|
||
- name: Print env | ||
run: echo "${{ toJSON(env)}}" | ||
|
||
- name: Print secrets | ||
run: echo "${{ toJSON(secrets)}}" | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build docker image (environment) | ||
run: | | ||
docker build -t ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }} -f Dockerfile . | ||
- name: Push docker image to GitHub Container Registry (environment) | ||
run: | | ||
docker push ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }} | ||
- name: Push docker image to GitHub Container Registry (production > staging) | ||
if: env.ENVIRONMENT == 'production' | ||
run: | | ||
docker push ghcr.io/killmenot/github-test-staging:${{ github.event.release.tag_name }} | ||
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,10 @@ | ||
name: Test | ||
|
||
on: [push, pull_request, release] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Print github context | ||
run: echo '${{ toJSON(github) }}' |
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,6 @@ | ||
FROM nginx:1.25.4-alpine | ||
|
||
COPY /static /usr/share/nginx/html | ||
RUN chown nginx.nginx /usr/share/nginx/html/ -R | ||
|
||
EXPOSE 80 |
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 |
---|---|---|
|
@@ -16,3 +16,6 @@ meet you and you may call me V. | |
- feature2 | ||
- hotfix1 | ||
- feature3 | ||
- feature4 | ||
- feature5 | ||
- feature6 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>Hello World</h1> | ||
h1> |