Updated requests #15
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
env: | |
DOCKER_URL: dcritchlow/football-dynasty | |
CI: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: install | |
run: npm install | |
- name: build | |
run: npm run build | |
- name: docker | |
run: docker build -t ${DOCKER_URL}:${GITHUB_SHA} . | |
- name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: push | |
run: docker push ${DOCKER_URL}:${GITHUB_SHA} | |
- name: tag main | |
if: github.ref == 'refs/heads/main' | |
run: | | |
docker tag ${DOCKER_URL}:${GITHUB_SHA} ${DOCKER_URL}:main | |
docker push ${DOCKER_URL}:main | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
id: buildx | |
- name: Set up Docker Tags | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_URL }} | |
tags: | | |
type=raw,value=${{ github.sha }} | |
type=raw,enable=${{ github.ref == 'refs/heads/main' }},value=main | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true |