diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..51f3c4b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -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 }} \ No newline at end of file diff --git a/container/entrypoint.sh b/container/entrypoint.sh old mode 100644 new mode 100755 index 521fc33..5288b90 --- a/container/entrypoint.sh +++ b/container/entrypoint.sh @@ -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 diff --git a/package-lock.json b/package-lock.json index ee7794e..b63d954 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "Discord-Manager", + "name": "app", "lockfileVersion": 3, "requires": true, "packages": {