Build and Push DevContainer #12
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: "Build and Push DevContainer" | |
| on: | |
| schedule: | |
| - cron: "0 1 1 * *" | |
| workflow_dispatch: | |
| jobs: | |
| build-and-push: | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Install Devcontainer CLI | |
| run: npm install -g @devcontainers/cli | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Get Current Year and Month | |
| run: echo "IMAGE_TAG=$(date +'%Y.%m')" >> $GITHUB_ENV | |
| - name: Build Devcontainer | |
| run: | | |
| devcontainer build .devcontainer --workspace-folder . --platform "linux/arm64,linux/amd64" --push --image-name kevintijssen/devcontainer-base:${{ env.IMAGE_TAG }} | |
| devcontainer build .devcontainer --workspace-folder . --platform "linux/arm64,linux/amd64" --push --image-name kevintijssen/devcontainer-base:latest |