try to fix mvt build #8
This file contains 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 and Push rapid7/metasploit-framework to burso/metasploit-framework | |
on: | |
push: | |
branches: | |
- main # Change to your default branch if not main | |
pull_request: | |
branches: | |
- main # Change to your default branch if not main | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Clone Metasploit Framework repository | |
run: git clone https://github.com/rapid7/metasploit-framework.git | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./metasploit-framework # Dockerfile should be in the root of this repo or modify the context accordingly | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/metasploit-framework:latest # Change the tag as needed | |
- name: Logout from Docker Hub | |
run: docker logout |