Skip to content

Commit

Permalink
Fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jan 2, 2024
1 parent 1f676fb commit 1fe1e6b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,40 @@ permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
packages: write

jobs:
# deploy docker to github registry
deployDocker:
if: github.event_name == 'release'
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ./Dockerfile
push: true
tags: docker.pkg.github.com/${{ github.repository }}/anser-static:${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# deploy static
deployStatic:
Expand All @@ -69,7 +73,7 @@ jobs:
if: github.event_name == 'release'
run: |
cd dist
zip -r ../anser-static-deploy.zip www
zip -r ../anser-static-deploy.zip .
cd ..
- name: "Upload to github releases"
Expand All @@ -81,7 +85,7 @@ jobs:
asset_name: anser-static-deploy.zip
asset_content_type: application/zip

# deploy static
# deploy gh pages
deployPages:
environment:
name: github-pages
Expand Down

0 comments on commit 1fe1e6b

Please sign in to comment.