Skip to content

chore: release v0.0.6 #32

chore: release v0.0.6

chore: release v0.0.6 #32

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
NUXT_HUB_PROJECT_KEY: ${{ secrets.NUXT_HUB_PROJECT_KEY }}
NUXT_HUB_USER_TOKEN: ${{ secrets.NUXT_HUB_USER_TOKEN }}
steps:
# Step 1: Checkout code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Install pnpm and Node.js
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: npm install -g cross-env
# Step 3: Get pnpm store directory and cache dependencies
- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Step 4: Install dependencies
- name: Install dependencies
run: pnpm install
# Step 5: Build the project
- name: Build the project
run: pnpm build
# Step 6: Deploy with NuxtHub
- name: Deploy to NuxtHub
run: |
pnpm test-deploy
# Step 7: Docker login and image build/tag/push
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and tag Docker image
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
docker build . -t ${{ secrets.DOCKER_USERNAME }}/introxd:latest
docker tag ${{ secrets.DOCKER_USERNAME }}/introxd:latest ${{ secrets.DOCKER_USERNAME }}/introxd:$TAG_NAME
- name: Push Docker image to Docker Hub
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
docker push ${{ secrets.DOCKER_USERNAME }}/introxd:latest
docker push ${{ secrets.DOCKER_USERNAME }}/introxd:$TAG_NAME