Skip to content

Commit

Permalink
Merge branch 'typescript-docker' into javascript-docker
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/template-updater.yml
#	.github/workflows/test-release.yml
#	package-lock.json
#	package.json
  • Loading branch information
sebbo2002 committed Dec 11, 2022
2 parents 19033e3 + 305c60d commit a3758bf
Show file tree
Hide file tree
Showing 3 changed files with 2,901 additions and 3,596 deletions.
45 changes: 19 additions & 26 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Test & Release
on:
push:
branches:
- develop
- main
branches-ignore:
- 'gh-pages'
- 'depfu/**'
- 'dependabot/**'
- 'template-updater/**'
pull_request: null

jobs:
tests:
name: Unit Tests
runs-on: ubuntu-latest
if: contains(toJson(github.event.commits.*.message), '[skip ci]') == false || github.ref == 'refs/heads/main'
if: github.repository != 'sebbo2002/js-template' && (contains(toJson(github.event.commits.*.message), '[skip ci]') == false || github.ref == 'refs/heads/main')
strategy:
matrix:
node: [14.x, 16.x, 18.x]
Expand All @@ -30,7 +32,7 @@ jobs:
license-checker:
name: License Checker
runs-on: ubuntu-latest
if: contains(toJson(github.event.commits.*.message), '[skip ci]') == false || github.ref == 'refs/heads/main'
if: github.repository != 'sebbo2002/js-template' && (contains(toJson(github.event.commits.*.message), '[skip ci]') == false || github.ref == 'refs/heads/main')
steps:
- name: ☁️ Checkout Project
uses: actions/checkout@v3
Expand Down Expand Up @@ -239,6 +241,7 @@ jobs:
exit 1
fi
- name: 🔄 Push container to DockerHub
id: docker-build-dh
if: ${{ env.PUSH_TO_DOCKERHUB == 'true' }}
uses: docker/build-push-action@v3
with:
Expand All @@ -261,7 +264,8 @@ jobs:
ghcr.io/${{ github.repository }}:build-container-${{ hashFiles('package*.json') }}
cache-to: type=inline
outputs:
digest: ${{ steps.docker-build-2.outputs.digest }}
digest-gh: ${{ steps.docker-build-2.outputs.digest }}
digest-dh: ${{ steps.docker-build-dh.outputs.digest }}

release:
name: Release
Expand All @@ -282,6 +286,12 @@ jobs:
uses: actions/setup-node@v3
with:
cache: 'npm'
- name: 🔧 Setup regclient
run: |
mkdir -p "$HOME/.local/bin"
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 > "$HOME/.local/bin/regctl"
chmod +x "$HOME/.local/bin/regctl"
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: 📦 Install dependencies
run: npm ci
- name: 📂 Create docs folder
Expand All @@ -297,23 +307,6 @@ jobs:
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: ⬇️ Pull GitHub Containers
id: github
run: |
docker pull "${IMAGE}@${DIGEST}"
echo "::set-output name=image::${IMAGE}@${DIGEST}"
env:
IMAGE: ghcr.io/${{ github.repository }}
DIGEST: ${{ needs.docker-image.outputs.digest }}
- name: ⬇️ Pull Docker Hub Containers
if: ${{ env.PUSH_TO_DOCKERHUB == 'true' }}
id: dockerhub
run: |
docker pull "${IMAGE}@${DIGEST}"
echo "::set-output name=image::${IMAGE}@${DIGEST}"
env:
IMAGE: ${{ github.repository }}
DIGEST: ${{ needs.docker-image.outputs.digest }}
- name: 🪄 Run semantic-release
run: BRANCH=${GITHUB_REF#refs/heads/} npx semantic-release
env:
Expand All @@ -324,11 +317,11 @@ jobs:
GITHUB_NPM_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLIC_NPM_CONFIG_REGISTRY: https://registry.npmjs.org
PUBLIC_NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DOCKER_LOCAL_IMAGE_GH: ${{ steps.github.outputs.image }}
DOCKER_LOCAL_IMAGE_DH: ${{ steps.dockerhub.outputs.image }}
DOCKER_LOCAL_IMAGE_GH: ghcr.io/${{ github.repository }}:${{ github.sha }}
DOCKER_LOCAL_IMAGE_DH: ${{ github.repository }}:${{ github.sha }}
- name: 🔃 Merge main back into develop
if: ${{ github.ref == 'refs/heads/main' }}
uses: everlytic/[email protected].2
uses: everlytic/[email protected].3
with:
github_token: ${{ secrets.GH_TOKEN }}
source_ref: 'main'
Expand Down
Loading

0 comments on commit a3758bf

Please sign in to comment.