Skip to content

Merge pull request #14 from opensource-force/dev/favicon #6

Merge pull request #14 from opensource-force/dev/favicon

Merge pull request #14 from opensource-force/dev/favicon #6

Workflow file for this run

name: Build and Deploy to GitHub Packages
on:
push:
branches:
- main # Adjust to your default branch
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Step 3: Set up Docker Buildx for multi-platform builds (optional but recommended)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 4: Build and push the Docker image to GitHub Container Registry
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/osf-site:latest
ghcr.io/${{ github.repository_owner }}/osf-site:${{ github.sha }}
# Step 5: Optional - Clean up unused Docker resources on the runner
- name: Prune Docker
run: docker system prune --all --force