Skip to content

Add Git Redeploy Option #8

Add Git Redeploy Option

Add Git Redeploy Option #8

Workflow file for this run

name: "Test"
on:
workflow_dispatch:
push:
jobs:
test:
name: "Test"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Write YAML"
id: yaml-action
uses: teunmooij/yaml@v1
with:
data: '{"version":"3.8","services":{"alpine":{"image":"alpine","command":"tail -f /dev/null"}}}'
to-file: "docker-compose.yaml"
- name: "Test Local Action"
id: test
uses: ./
with:
token: ${{ secrets.PORTAINER_TOKEN }}
url: ${{ secrets.PORTAINER_URL }}
name: alpine-test
file: docker-compose.yaml
type: file
- name: "Echo Output"
run: |
echo 'stackID: ${{ steps.test.outputs.stackID }}'
echo 'swarmID: ${{ steps.test.outputs.swarmID }}'
echo 'endpointID: ${{ steps.test.outputs.endpointID }}'
#- name: "Call API"
# uses: indiesdev/[email protected]
# with:
# url: "${{ secrets.PORTAINER_URL }}/api/stacks/${{ steps.test.outputs.stackID }}"
# method: "DELETE"
# accept: 204
# headers: '{ "X-API-Key": "${{ secrets.PORTAINER_TOKEN }}" }'
# params: '{ "endpointId": "${{ steps.test.outputs.endpointID }}" }'
# timeout: 5000
# log-response: true
# retries: 1
lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: 20
- name: "ESLint"
run: |
npm install
npm run lint
build:
name: "Build"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: 20
- name: "Build"
run: |
npm install
npm run build
- name: "Verify"
run: |
git status --porcelain dist/
if [ ! -d "dist" ];then
echo "Missing dist directory, run: npm build"
exit 1
fi
if [ -n "$(git status --porcelain dist)" ];then
echo "Build was not run, run: npm build"
exit 1
fi