Skip to content

Commit

Permalink
Dev/ci optimization (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
yacosta738 authored Dec 26, 2023
1 parent 67d15ae commit 1c81cf7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 58 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/deploy-container-image.yml

This file was deleted.

61 changes: 60 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,35 @@ on:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
contents: write
pages: write
id-token: write
pull-requests: write
repository-projects: write

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4

- name: Install Tools & Dependencies
uses: ./.github/actions/install

- name: Create Release 🚀
uses: ridedott/release-me-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release-branches: '["main"]'
node-module: true

- name: Install, build, and upload your site
uses: withastro/action@v1
# with:
Expand All @@ -41,3 +60,43 @@ jobs:
uses: actions/deploy-pages@v4
env:
FORMSPREE: ${{ secrets.FORMSPREE }}

deploy-container-image:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9dc751fe249ad99385a2583ee0d084c400eee04e
with:
images: |
n4t5u/${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build the container image
run: pnpm run build # build:docker

- name: Build and push Docker image
uses: docker/build-push-action@9f6f8c940b91232557f8699b21341a08624a8dce
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 1c81cf7

Please sign in to comment.