➕️ Add docker extension; leverage code-server CMD in Helm chart #74
This file contains hidden or 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: Automated Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| # Note: this is copy-pasted and adapted from | |
| # https://github.com/jpetazzo/workflows/blob/main/.github/workflows/automated-build.yaml | |
| # I need to find an elegant way to manage the multi-target built 🤔 | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - | |
| name: Set environment variables | |
| run: | | |
| IMAGES="" | |
| if [ "${{ secrets.DOCKER_HUB_TOKEN }}" ]; then | |
| echo PUSH_TO_DOCKER_HUB=yes >> $GITHUB_ENV | |
| IMAGES="$IMAGES docker.io/${{ github.repository }}" | |
| if [ "${{ inputs.DOCKER_HUB_USERNAME }}" ]; then | |
| echo DOCKER_HUB_USERNAME="${{ inputs.DOCKER_HUB_USERNAME }}" >> $GITHUB_ENV | |
| else | |
| echo DOCKER_HUB_USERNAME="${{ github.repository_owner }}" >> $GITHUB_ENV | |
| fi | |
| fi | |
| if true; then | |
| echo PUSH_TO_GHCR=yes >> $GITHUB_ENV | |
| IMAGES="$IMAGES ghcr.io/${{ github.repository }}" | |
| fi | |
| echo 'IMAGES<<EOF' >> $GITHUB_ENV | |
| for IMAGE in $IMAGES; do | |
| echo $IMAGE >> $GITHUB_ENV | |
| if [ "$GITHUB_REF_TYPE" == "tag" ]; then | |
| echo $IMAGE:$GITHUB_REF_NAME >> $GITHUB_ENV | |
| fi | |
| done | |
| echo 'EOF' >> $GITHUB_ENV | |
| - | |
| uses: actions/checkout@v3 | |
| - | |
| name: Log into Docker Hub | |
| if: env.PUSH_TO_DOCKER_HUB | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ env.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - | |
| name: Log into GitHub Container Registry | |
| if: env.PUSH_TO_GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - | |
| uses: docker/setup-qemu-action@v2 | |
| - | |
| uses: docker/setup-buildx-action@v2 | |
| - | |
| uses: docker/build-push-action@v3 | |
| with: | |
| platforms: ${{ inputs.PLATFORMS }} | |
| push: true | |
| tags: ${{ env.IMAGES }} | |
| - | |
| uses: docker/build-push-action@v3 | |
| with: | |
| platforms: ${{ inputs.PLATFORMS }} | |
| push: true | |
| target: vspod | |
| tags: jpetazzo/shpod:vspod,ghcr.io/jpetazzo/shpod:vspod |