CI: GitHub: fix conditional syntax
This is strange because the docs say that it's required [1], but during
my testing it appeared to work just fine without this wrapping. Anyway,
let's follow the docs.
[1]
@@ -29,7 +29,7 @@ jobs:
pypi:
needs: build
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Telecominfraproject'
+ if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Telecominfraproject' }}
name: PyPI packaging
runs-on: ubuntu-latest
steps:
@@ -48,7 +48,7 @@ jobs:
docker:
needs: build
- if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && github.repository_owner == 'Telecominfraproject'
+ if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && github.repository_owner == 'Telecominfraproject' }}
name: Docker image
runs-on: ubuntu-latest
steps:
@@ -61,12 +61,12 @@ jobs:
with:
fetch-depth: 0
- name: Extract tag name
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
id: extract_pretty_git
run: echo ::set-output name=GIT_DESC::$(git describe --tags)
- name: Build and push a container
uses: docker/build-push-action@v2
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
with:
context: .
push: true
@@ -74,12 +74,12 @@ jobs:
telecominfraproject/oopt-gnpy:${{ steps.extract_pretty_git.outputs.GIT_DESC }}
telecominfraproject/oopt-gnpy:master
- name: Extract tag name
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
+ if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
id: extract_tag_name
run: echo ::set-output name=GIT_DESC::${GITHUB_REF/refs\/tags\//}
- name: Build and push a container
uses: docker/build-push-action@v2
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
+ if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
with:
context: .
push: true
