File size: 866 Bytes
5c93969
 
 
 
 
 
 
 
 
 
 
 
 
668c539
 
 
 
 
 
 
 
 
 
 
 
6405d92
 
 
668c539
 
 
6405d92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Docker Image CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Check out the repository
      uses: actions/checkout@v4

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v2

    - name: Log in to Docker Hub
      uses: docker/login-action@v2
      with:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}

    - name: List files in the repository root
      run: ls -alh

    - name: Build and push Docker image
      run: |
        docker buildx build --file ./Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/picpilot:$(date +%s) --push --cache-to=type=local,dest=/tmp/.buildx-cache,new=true --cache-from=type=local,src=/tmp/.buildx-cache .
      working-directory: ${{ github.workspace }}