ci: add ci.yml

dev
wxh 2 years ago
parent 50cfcedde0
commit 7e6ed0bcd4

@ -0,0 +1,36 @@
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

@ -1,6 +1,6 @@
FROM ubuntu:latest FROM ubuntu:latest
RUN cp /bin/bash /bin/sh # RUN cp /bin/bash /bin/sh
RUN apt update && apt install -y wget RUN apt update && apt install -y wget

Loading…
Cancel
Save