Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko259 committed Jul 30, 2024
2 parents 19c771b + b052977 commit f10d8f0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: "Build"

on:
push:
paths-ignore:
- "**.md"

env:
IMAGE_NAME: vatsim-scandinavia/handover
TARGET_PLATFORMS: linux/amd64,linux/arm64

jobs:
build-container:
name: Build Events Container
runs-on: ubuntu-latest
steps:
- name: configure docker buildx
uses: docker/setup-buildx-action@v2

- name: login to github container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: setup container metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=sha,event=branch,prefix=
type=semver,event=tag,pattern=v{{version}}
type=semver,event=tag,pattern=v{{major}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: build & push container image
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:."
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.TARGET_PLATFORMS }}
4 changes: 2 additions & 2 deletions container/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ SELF_SIGNED_CERT=/etc/ssl/certs/apache-selfsigned.crt

if [ ! -f "$SELF_SIGNED_KEY" ] || [ ! -f "$SELF_SIGNED_CERT" ]; then
# Generate a self-signed cert to support SSL connections
openssl req -x509 -nodes -days 358000 -newkey rsa:2048 -keyout "$SELF_SIGNED_KEY" -out "$SELF_SIGNED_CERT" -subj "/O=Your vACC/CN=Control Center"
openssl req -x509 -nodes -days 358000 -newkey rsa:2048 -keyout "$SELF_SIGNED_KEY" -out "$SELF_SIGNED_CERT" -subj "/O=Your vACC/CN=Events"
fi

if [ -z "$APP_KEY" ] && [ ! -f "$CONTROL_CENTER_ROOT/.env" ]; then
echo "################################################################################"
echo "WARNING: You need to follow the configuration guide for Control Center"
echo "WARNING: You need to follow the configuration guide"
echo "################################################################################"
echo "WARNING: Copying over example .env file"
cp container/example-prod.env .env
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f10d8f0

Please sign in to comment.