Merge pull request #5 from Jarvl/image-tweaks #10
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: Build and deploy application | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.REGISTRY }} | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Setup node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.15.3' | |
- name: Install dependencies | |
run: npm install | |
- name: Build application | |
run: npm run build | |
# See: https://github.com/orgs/community/discussions/25768#discussioncomment-3249186 | |
- name: Set lowercase image name env var | |
run: | | |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Build and push image | |
run: | | |
docker buildx build --platform linux/arm64 -t "${{ secrets.REGISTRY }}/$IMAGE_NAME:latest-arm64" --push . |