Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[⚙️🐳] Added image build action #40

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build & Publish Docker Image

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on:
push:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=match,pattern=main
type=raw,value=latest,enable={{is_default_branch}}
flavor: |
latest=auto

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-vps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:

docker compose up -d --build

docker image prune -f
docker image prune -a
EOF
4 changes: 3 additions & 1 deletion src/_layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ title: CS++
<meta property="og:image:width" content="120" >
<meta property="og:image:height" content="63" >

<script defer data-domain="cspp.ie" src="https://plausible.io/js/script.js"></script>
<script defer data-domain="cspp.ie" src="https://plausible.cspp.ie/js/script.file-downloads.outbound-links.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>


<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/ua-parser.min.js"></script>
<script>
Expand Down
Loading