Skip to content

chore(deps): update node.js to v20 (#622) #3

chore(deps): update node.js to v20 (#622)

chore(deps): update node.js to v20 (#622) #3

Workflow file for this run

name: Docker -- GHCR
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'docker/**/*'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
images: [landing]
steps:
- name: Checkout code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- name: Log in to the GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
cd docker/${{ matrix.images }}
docker build . \
--tag ghcr.io/freecodecamp/${{ matrix.images }}:${{ github.sha }} \
--tag ghcr.io/freecodecamp/${{ matrix.images }}:latest
docker push --all-tags ghcr.io/freecodecamp/${{ matrix.images }}