You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1017 B
37 lines
1017 B
2 years ago
|
name: ci
|
||
|
|
||
|
on:
|
||
|
workflow_dispatch:
|
||
|
push:
|
||
|
branches:
|
||
|
- 'master'
|
||
|
tags:
|
||
|
- 'v*'
|
||
|
pull_request:
|
||
|
branches:
|
||
|
- 'master'
|
||
|
|
||
|
jobs:
|
||
|
docker:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
-
|
||
|
name: Checkout
|
||
|
uses: actions/checkout@v3
|
||
|
-
|
||
|
name: Login to DockerHub
|
||
|
if: github.event_name != 'pull_request'
|
||
|
uses: docker/login-action@v2
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
|
||
|
-
|
||
|
name: Build and push
|
||
|
if: ${{ github.event_name != 'pull_request' }}
|
||
|
run: |
|
||
|
docker buildx build --platform=linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} .
|
||
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}}
|
||
|
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/aquery:${{github.sha}} ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest
|
||
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aquery:latest
|