Skip to content

V2

V2 #613

Workflow file for this run

name: CI/CD
on: # rebuild any PRs and main branch changes
pull_request:
release:
types: [created, published, edited]
push:
branches:
- master
- "releases/*"
jobs:
ci:
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: 8
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts
- name: Run integration tests
run: pnpm run test
cd:
name: Deployment
needs: ci
runs-on: ubuntu-latest
steps:
- id: docker-tag
run: |
tag=$( \
echo ${{ github.ref_name }} \
| sed 's#refs/heads/##g' \
| sed 's#refs/tags/##g' \
| sed 's#refs/pull/##g' \
| tr '/' '_' \
| tr -d '#' \
)
if [ "$tag" == "master" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=$tag" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: manusa/actions-publish-docker@db938e45d2a3487e0eab9646e83550f554c17af3
name: Build & publish Docker image
with:
name: 47ng/actions-clever-cloud
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
include pull requests: true
tag: ${{ steps.docker-tag.outputs.tag }}
- run: docker push ghcr.io/47ng/actions-clever-cloud:${{ steps.docker-tag.outputs.tag }}
env:
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ github.actor }}