fix: use python for version check instead of bc #105
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 swpwn docker image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: 'Log level' | |
| required: true | |
| default: 'warning' | |
| tags: | |
| description: 'Test scenario tags' | |
| push: | |
| branches: main | |
| paths: | |
| - 'build/**' | |
| schedule: | |
| - cron: '0 0 1 * *' | |
| jobs: | |
| all: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| VERSION: ["20.04", "22.04", "24.04"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Login to Dockerhub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: beswing | |
| password: ${{secrets.DOCKER_HUB_TOKEN}} | |
| - name: Build and push ubuntu ${{ matrix.VERSION }} | |
| run: | | |
| ls -al . | |
| sed -i -e 's/FROM ubuntu:22.04/FROM ubuntu:${{ matrix.VERSION }}/g' build/Dockerfile | |
| docker build -t beswing/swpwn:${{ matrix.VERSION }} build/ | |
| docker push beswing/swpwn:${{ matrix.VERSION }} |