Updated CI and nginx.conf for Svelte port #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to registry | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: http://registry.ellite.dev/ | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: registry.ellite.dev/raibu-web:${{ steps.get_version.outputs.VERSION }} | |
- name: Check if tag is the latest | |
id: check_latest | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const tags = await github.repos.listTags({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
const versions = tags.data.map(tag => tag.name).sort((a, b) => semver.rcompare(a, b)); | |
return versions[0] === '${{ steps.get_version.outputs.VERSION }}'; | |
- name: Build and push latest | |
if: steps.check_latest.outputs.result == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: registry.ellite.dev/raibu-web:latest | |
- name: Test image | |
run: | | |
docker pull registry.ellite.dev/raibu-web:${{ steps.get_version.outputs.VERSION }} | |
if [ $? -eq 0 ]; then | |
echo "Image exists" | |
else | |
echo "Image does not exist" | |
exit 1 | |
fi | |
- name: Trigger Portainer Webhook | |
run: | | |
curl -X POST https://portainer.ellite.dev/api/stacks/webhooks/5ba12a57-5c0e-4588-b9f6-3a55e4bc567d | |
tarball: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create copy of workspace | |
run: | | |
mkdir ../temp_workspace | |
cp -r . ../temp_workspace | |
- name: Create tarball | |
run: | | |
tar --exclude='./.git' -czvvf raibu-web.tar.gz ../temp_workspace | |
- name: Upload tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: raibu-web | |
path: raibu-web.tar.gz |