Skip to content

[testing] docker workflows #10

[testing] docker workflows

[testing] docker workflows #10

name: Build Docker Container
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
push:
branches:
- 'main'
schedule:
- cron: '0 0 * * *'
env:
DEV: ${{ github.base_ref == "main"}}

Check failure on line 14 in .github/workflows/build-container.yml

View workflow run for this annotation

GitHub Actions / Build Docker Container

Invalid workflow file

The workflow is not valid. .github/workflows/build-container.yml (Line: 14, Col: 8): Unexpected symbol: '"main"'. Located at position 20 within expression: github.base_ref == "main" .github/workflows/build-container.yml (Line: 37, Col: 14): Unexpected symbol: '"main"'. Located at position 20 within expression: github.base_ref == "main"
NAME: ${{ github.event.number }}
permissions:
contents: read
packages: write
jobs:
build-container:
name: Build sparseml container
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: debug
run: |
echo $DEV
echo ${{github.head_ref}}
echo ${{github.event_name}}
echo ${{github.event.action}}
echo ${{github.ref_name}}
echo ${{ github.base_ref == "main"}}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Dev Docker Container
if: ${{ env.DEV == 'true' }}
uses: docker/build-push-action@v4
with:
context: ./docker_dev
build-args: |
BRANCH=${{ github.ref_name }}
- name: Build Nightly Docker Container
if: ${{ env.DEV == 'false' }}
uses: docker/build-push-action@v4
with:
context: ./docker_nightly
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/neuralmagic/test-sparseml-nightly:latest, ghcr.io/neuralmagic/test-sparseml-nightly:${{ steps.date.outputs.date }}